﻿<%@ Page Title="图书管理" Language="C#" MasterPageFile="~/Admin/AdminMaster.Master" AutoEventWireup="true" CodeBehind="BookManage.aspx.cs" Inherits="BookManageSys.Admin.BookManage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="~/assert/Css/bootstrap.min.css" rel="stylesheet" />
    <style type="text/css">
        .auto-style2 {
            text-align: right;
        }
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <div class="container mt-4">
        <h2 class="text-center">图书管理</h2>
    </div>
    <div>
        <tr>
            <td class="auto-style6">商品名称：<asp:TextBox ID="TxtSearch" runat="server"></asp:TextBox>
                            &nbsp;&nbsp;&nbsp;
                <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="查询" />
                            &nbsp;&nbsp;
        <asp:CheckBox ID="ChkPage" runat="server" OnCheckedChanged="CheckBox1_CheckedChanged1" Text="是否分页显示" AutoPostBack="True" />
&nbsp;&nbsp; &nbsp;
                <asp:HyperLink ID="HyperLink8" runat="server" NavigateUrl="~/Admin/BookAdd.aspx">添加商品</asp:HyperLink>
            </td>
        </tr>
    </div>

    <div>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Width="100%" PageSize="5" 
            CssClass="table table-bordered table-striped" OnRowCommand="GridView1_RowCommand">
            
            <Columns>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:CheckBox ID="chkSelect" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>

                <asp:BoundField DataField="productid" HeaderText="商品ID" />
                <asp:BoundField DataField="productname" HeaderText="商品名称" />
                <asp:BoundField DataField="description" HeaderText="描述" />
                <asp:BoundField DataField="price" HeaderText="价格" />
                <asp:BoundField DataField="stockquantity" HeaderText="库存量" />
                <asp:BoundField DataField="salesquantity" HeaderText="销售量" />
                <asp:ImageField DataImageUrlField="image" HeaderText="图片">
                    <ControlStyle Height="50px" Width="50px" />
                </asp:ImageField>

                <asp:TemplateField HeaderText="删除">
                    <ItemTemplate>
                        <asp:Button ID="Button1" runat="server" CommandArgument='<%# Eval("productid") %>' CommandName="删除" Text="删除" OnClientClick="return confirm('你确认要删除吗？');" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="更新">
                    <ItemTemplate>
                        <asp:Button ID="Button3" runat="server" CommandArgument='<%# Eval("productid") %>' CommandName="更新" Text="编辑" />
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </div>
    <div>
        <asp:Panel ID="PnlPage" runat="server" Visible="false">
            <p class="text-center">
                <asp:Button ID="BtnLastPage" runat="server" Text="上页" OnClick="BtnLastPage_Click" />
                &nbsp;
                <asp:TextBox ID="TxtPageNum" runat="server" Width="20px" ReadOnly="True">1</asp:TextBox>
                &nbsp;
                <asp:Button ID="BtnNextPage" runat="server" Text="下页" OnClick="BtnNextPage_Click" />
                &nbsp;
                <br />
                每页显示<asp:TextBox ID="TxtCount" runat="server" AutoPostBack="True" OnTextChanged="TextBox1_TextChanged" Width="63px">10</asp:TextBox>条数据&nbsp;
            </p>
        </asp:Panel>
        <p>
            <asp:CheckBox ID="ChkAll" runat="server" Text="全选" AutoPostBack="True" OnCheckedChanged="CheckBox1_CheckedChanged"/>
        </p>
        <p class="auto-style2">
            <asp:Button ID="Button4" runat="server" Text="批量删除" OnClick="Button4_Click" />
        </p>
    </div>
</asp:Content>
